package com.aya;

import java.util.ArrayList;
import java.util.List;

/**
 * 组控件抽象
 */
public class AdvancedControl extends Control{
    private List<Control> controls = new ArrayList<>();

    public void add(Control element) {
        controls.add(element);
    }

    public Control remove(int index) {
        return controls.remove(index);
    }


    @Override
    protected void paint() {
        for (Control control:controls){
            control.paint();
        }
    }
}
